package cn.hesion.Proxy.Cglib;
/**
 * ClassName: InterfaceTest <br/>
 * Description: <br/>
 * date: 2021/12/25 22:10<br/>
 *
 * @author Hesion<br />
 * @version
 * @since JDK 1.8
 */

/**
 * 测试用CGlib实现动态方法的实现
 * @author: hesion
 * @create: 2021-12-25 22:10
 **/
public class InterfaceTest {
    public static void main(String[] args) {
        Zhangsan zhang = new Zhangsan();
        Lisi li = new Lisi();
        IPersonDoService zhangproxy = new CglibFactory(zhang).myCGlibCreator();
        System.out.println("---------------");
        System.out.println("zhangsan未被代理");
        zhang.run();
        zhang.jump();
        System.out.println("---------------");
        System.out.println("zhang被代理");
        zhangproxy.run();
        zhangproxy.jump();
        System.out.println("---------------");
        System.out.println("李四未必代理");
        li.run();
        li.jump();
        System.out.println("---------------");
        System.out.println("李四被代理");
        IPersonDoService lisiproxy = new CglibFactory(li).myCGlibCreator();
        lisiproxy.run();
        lisiproxy.jump();
    }
}
